// Decompiled by GOOSIN CO,LTD Copyright 2010 Pavel Kouznetsov.
// home page: http://www.Goosin.net
// Decompiler options: packimports(3) fieldsfirst ansi space 
// Source File Name:   Fieldvalue.java

package intrmanufacture;

import include.nseer_db.nseer_db;
import java.sql.ResultSet;

public class Fieldvalue
{

	private String dbase;
	private String table;
	private String fieldName1;
	private String fieldValue1;
	private String fieldName2;
	private String value;
	private String sql;
	private ResultSet rs;

	public Fieldvalue()
	{
		dbase = "";
		table = "";
		fieldName1 = "";
		fieldValue1 = "";
		fieldName2 = "";
		value = "";
		sql = "";
		rs = null;
	}

	public String getValue(String dbase, String table, String field1, String value1, String field2)
	{
		this.dbase = dbase;
		this.table = table;
		fieldName1 = field1;
		fieldValue1 = value1;
		fieldName2 = field2;
		nseer_db dba = new nseer_db(dbase);
		try
		{
			sql = (new StringBuilder("select * from ")).append(table).append(" where ").append(field1).append("='").append(fieldValue1).append("'").toString();
			rs = dba.executeQuery(sql);
			if (rs.next())
				value = rs.getString(fieldName2);
			dba.close();
		}
		catch (Exception ex)
		{
			ex.printStackTrace();
		}
		return value;
	}
}
